import time
def bubble (array):
    for i in range(N-1):
        for j in range(N-i-1):
            if array [j] > array[j+1]:
                buff = array[j]
                array[j] = array[j+1]
                array[j+1] = buff
c=["m1_sorted.txt","m2_reverse.txt","m3_shuffle.txt"]
for k in c:
    f = open(k)
    a = [int(i) for i in f]
    N=len(a)

    start_time = time.time()
    bubble(a)
    end_time = time.time()
    execution_time = (end_time - start_time)*1000
    print(k[:-4],f"{execution_time} millisecods")